#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""

"""

__author__ = 'Chris'
__email__ = 'themaluyao@outlook.com'
__gitee__ = 'https://gitee.com/luyaoCode'
__since__ = '2022/4/4 19:28'

from omegaconf import DictConfig

from pythonarchetype.middleware.LoguruAdapter import LoguruAdapter


class PythonArchetype(object):

    def __init__(self, cfg: DictConfig, logger=False):
        self.cfg = cfg
        self.logger = None
        if logger:
            self.init_logger(logger)
        else:
            self.init_logger(LoguruAdapter(), use_default_logger=True)

    def init_logger(self, logger, use_default_logger=False):
        self.logger = logger

        if use_default_logger:
            self.logger = self.logger.config(self.cfg)

    def run(self):
        self.logger.info(f'{self.cfg}')
        pass
